package com.example.dmweb.chat.ElectricityPrice;

import com.example.dmcommom.ResponseResult;
import com.example.dmdomain.entity.ElectricityPriceKeyword;
import com.example.dmweb.chat.chatService.FileUploadResponse;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/electricityPrice")
@Slf4j
public class ElectricityPriceKeywordController {

    @Autowired
    private ElectricityPriceKeywordService electricityPriceKeywordService;

    @RequestMapping(value = "/chatList", method = {RequestMethod.GET})
    public ResponseResult<String> chatList() {
        System.out.println("success");
        return ResponseResult.success();
    }

    //获取所有的数据
    @RequestMapping(value = "/getAllKeywords", method = {RequestMethod.GET})
    public ResponseResult< List<ElectricityPriceKeyword>> getAllKeywords() {
        List<ElectricityPriceKeyword> allKeywords = electricityPriceKeywordService.getAllKeywords();
        System.out.println("success");
        return ResponseResult.success(allKeywords);
    }

    //获取 随机的  3条数据
    @RequestMapping(value = "/getRandomKeyword", method = {RequestMethod.GET})
    public ResponseResult< List<ElectricityPriceKeyword>> getRandomKeyword() {
        List<ElectricityPriceKeyword> randomKeyword = electricityPriceKeywordService.getRandomKeyword();
        System.out.println("success");
        return ResponseResult.success(randomKeyword);
    }


}
